cmake_minimum_required(VERSION 3.0.2)

set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-std=c++17")
#add_difinitions(-Wall -Werror)
# set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 
project(camera)

find_package(catkin REQUIRED COMPONENTS
  rm_interfaces
  dynamic_reconfigure
  cv_bridge_new
  image_transport
  roscpp
  sensor_msgs
  std_msgs
)
find_package(OpenCV REQUIRED)
catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES camera
#  CATKIN_DEPENDS cv_bridge dynamic_reconfigure image_transport roscpp sensor_msgs std_msgs
#  DEPENDS system_lib
)

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
)

add_executable(camera_node "src/camera_node.cpp")
add_dependencies(camera_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_dependencies(camera_node configures_gencfg)
target_link_libraries(camera_node
  ${catkin_LIBRARIES}
  ${OpenCV_LIBS}
  libgxiapi.so
)

execute_process(COMMAND chmod a+x scripts/video_play.py
        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
        RESULT_VARIABLE cmd_result
        OUTPUT_VARIABLE cmd_ver)
